/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-03-27
 * Time: 23:39
 */
public class Main {
    public static void eating(Animal animal) {
        animal.eat();
    }
    public static void runing(Runnable runnable) {
        runnable.run();
    }
    public static void fiying(Flyable flyable) {
        flyable.fly();
    }
    public static void swimming(Swimmable swimmable) {
        swimmable.swim();
    }
    public static void main(String[] args) {
        // 创建不同动物对象
        Bird bird = new Bird("麻雀");
        Duck duck = new Duck("鸭子");
        Fish fish = new Fish("锦鲤");
        Penguin penguin = new Penguin("企鹅");
        eating(bird);
       /* 输出：
        麻雀正在吃东西...
       麻雀吃鸟粮*/
        eating(fish);//吃鱼粮
        eating(duck);//鸭子吃饲料
        runing(duck);//鸭子嘎嘎跑
        runing(penguin);//企鹅在冰面上笨拙地滑行！
        fiying(bird);//麻雀鸟正在飞！
        fiying(duck);//鸭子扑腾翅膀低空飞行
        swimming(fish);//锦鲤在水中游！
        swimming(duck);//鸭子用脚蹼划水游泳
        swimming(penguin);//企鹅用翅膀划水游泳！

    }
}
